package Week4.J0507;

import java.util.Scanner;

public class 经此一役小红所向无敌 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long h = scanner.nextLong();
        long b = scanner.nextLong();
        long k = scanner.nextLong();

        long sum = 0;
        while (h > 0 && k > 0) {
            sum += a;
            sum += b;
            k -= a;
            h -= b;
        }

        if (h <= 0 && k > 0) sum += 10 * b;
        if (k <= 0 && h > 0) sum += 10 * a;

        System.out.println(sum);
    }
}
